package com.car.account.controller;


import com.car.account.dto.storesResource.StoresResourceDto;
import com.car.account.service.StoresResourceService;
import com.car.commons.core.model.Result;
import com.car.commons.core.util.JwtUtil;
import com.car.commons.web.util.WebUtil;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.ArrayList;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 董旭
 * @since 2024-08-28
 */
@RestController
@RequestMapping("/storesResource")
public class StoresResourceController {
    @Resource
    private StoresResourceService storesResourceService;
    @GetMapping("/load.md")
    public Result load() throws Exception {
        String token = WebUtil.getToken();
        Integer clerkId = JwtUtil.getClerkId(token);
        ArrayList<StoresResourceDto> platformResourceDtos= storesResourceService.load(clerkId);
        return Result.getResult().setMsg("加载权限成功").setData(platformResourceDtos);
    }
}

